{% extends "./layout.html" %} {% block title %}Benefits Start Date{% endblock %} {% block content %}
<div class="row">
    <div class="col-lg-12">

        {% if updateSuccess %}
        <div class="row">
            <div class="col-lg-12">
                <div class="alert alert-dismissable alert-success">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    Benefits updated successfully.
                </div>
            </div>
        </div>
        <!-- /.row -->
        {% endif %} {% if updateError %}
        <div class="row">
            <div class="col-lg-12">
                <div class="alert alert-dismissable alert-danger">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    {{data.updateError}}
                </div>
            </div>
        </div>
        <!-- /.row -->
        {% endif %}
    </div>
</div>


<div class="row">
    <div class="col-lg-12">



        <div class="table-responsive">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th class="col-md-1">Employee ID</th>
                        <th class="col-md-2">First Name</th>
                        <th class="col-md-2">Last Name</th>
                        <th class="col-md-7">Benefits Start Date</th>
                    </tr>
                </thead>
                <tbody>

                    {% for user in users %}

                    <tr>
                        <td>{{user._id.toString()}}</td>
                        <td>{{user.firstName}}</td>
                        <td>{{user.lastName}}</td>
                        <td>
                            <form method="POST" action="/benefits">
                                <div class="input-group">
                                    <input type="hidden" name="userId" value="{{user._id.toString()}}"></input>
                                    <input type="date" class="form-control" name="benefitStartDate" value="{{user.benefitStartDate}}"></input>
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-default">Save</button>
                                    </span>
                                </div>
                                <!-- /input-group -->
                            </form>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>

        </div>
        <!-- /.row -->
    </div>
</div>

{% endblock %}